package com.jetty;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.handler.AbstractHandler;

public class HelloHandler extends AbstractHandler {


	@Override
	public void handle(String target, Request baseRequest, HttpServletRequest request,
			HttpServletResponse response) throws IOException, ServletException {
		response.setContentType("text/html;charset=utf-8"); 
		response.setStatus(HttpServletResponse.SC_OK); 
		baseRequest.setHandled(true); 
		//throw new IOException("报500测试");
		response.getWriter().println("<h1>Hello World2</h1>"); 
		
	} 
	

} 
